


using BlogApp.Domain;
using BlogApp.Repository;
using Microsoft.EntityFrameworkCore;

var builder = WebApplication.CreateBuilder(args);

var conString = builder.Configuration.GetConnectionString("mysql");

builder.Services.AddDbContext<BlogDbContext>(p =>
{
    p.UseMySql(conString, ServerVersion.AutoDetect(conString));
});

builder.Services.AddScoped(typeof(IRepository<>), typeof(EfRepository<>));
builder.Services.AddControllers();


var app = builder.Build();



app.MapControllers();
app.Run();

